package com.xin.util;

import io.swagger.models.auth.In;

/**
 * 排序：党委机关 党政机关 行政机关 教学科研 教辅单位 直属业务 直附属单位（包含附属单位） 校办产业 产业单位 其他人员
 * created by l1 on 2017/11/29.
 */
public enum CategoryEnum {
    dangweijiguan(0,"dangweijiguan","党委机关"),
    dangzhengzhiguan(1,"dangzhengzhiguan","党政机关"),
    xingzhengjiguan(2,"xingzhengjiguan","行政机关"),
    jiaoxuekeyan(3,"jiaoxuekeyan","教学科研"),
    jiaofudanwei(4,"jiaofudanwei","教辅单位"),
    zhishuyewu(5,"zhishuyewu","直属业务"),
    zhifushudanwei(6,"zhifushudanwei","直附属单位"),
    fushudanwei(7,"fushudanwei","附属单位"),
    xiaobanchanye(8,"xiaobanchanye","校办产业"),
    chanyedanwei(9,"chanyedanwei","产业单位"),
    qitarenyuan(10,"qitarenyuan","其他人员");

    private Integer order;
    private String pinyin;
    private String name;
    CategoryEnum(Integer order ,String pinyin,String name){
        this.order = order;
        this.pinyin = pinyin;
        this.name = name;
    }

    public static  Integer getOrder(String name){
        CategoryEnum[] values = CategoryEnum.values();
        for (CategoryEnum categoryEnum : values) {
            if(categoryEnum.name.equals(name.trim())){
                return categoryEnum.order;
            }
        }
        return null;
    }
}
